import { pushorder } from 'network/request.js'

export function paymoney(goodlist,userid,address='',total,usernumber,type) {
    let time = new Date();
    time = time.toLocaleString();
    let userorderinfo = {
      orderid: Guid(),
      goodlist: goodlist,
      paytime: time,
      userid: userid,
      address: address,
      total: total,
      staus: '已支付',
      type: type,
      usernumber: usernumber,
    };
    return pushorder(userorderinfo)
  }
function Guid() {
    var guid = "";
    for (var i = 1; i <= 16; i++) {
      var n = Math.floor(Math.random() * 16.0).toString(16);
      guid += n;
      // if (i == 8 || i == 12 || i == 16 || i == 20) guid += "-";
    }
    return "order-" + guid;
  }